package com.example.homescreen.model;

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import com.google.android.gms.maps.*;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;

import com.example.homescreen.R;

public class GoogleMapDisplay extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_google_map);
		Double latI = (Double)getIntent().getDoubleExtra("Latitude", 0);
		Double longI = (Double)getIntent().getDoubleExtra("Longitude", 0);
		String address = (String)getIntent().getStringExtra("Address");
		GoogleMap map = ((MapFragment) getFragmentManager().findFragmentById(
				R.id.map)).getMap();

		LatLng sydney = new LatLng(latI, longI);

		//map.setMyLocationEnabled(true);
		map.moveCamera(CameraUpdateFactory.newLatLngZoom(sydney, 18));

		map.addMarker(new MarkerOptions().title(address)
				.snippet("Food")
				.position(sydney));
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.google_map, menu);
		return true;
	}

}
